#include "fixedratebondforwardwrap.h"

FixedRateBondForwardWrap::FixedRateBondForwardWrap(QuantLib::FixedRateBondForward fwdBond, const QuantLib::FixedRateBond& bond, int settlementDate, int deliveryDate, double factor, double price):QuantLib::FixedRateBondForward(fwdBond),underlying_(bond)
{
	factor_ = factor;
	price_ = price;
	settlementDate_ = settlementDate;
	deliveryDate_ = deliveryDate;
}

FixedRateBondForwardWrap::~FixedRateBondForwardWrap(void){}

QuantLib::Real FixedRateBondForwardWrap::NPV()
{
	return QuantLib::FixedRateBondForward::NPV() * factor_;
}

QuantLib::Real FixedRateBondForwardWrap::price()
{
	return price_;
}

QuantLib::Date FixedRateBondForwardWrap::deliveryDate()
{
	return QuantLib::Date(deliveryDate_);
}

QuantLib::Date FixedRateBondForwardWrap::settlementDate()
{
	return QuantLib::Date(settlementDate_);
}

QuantLib::Real FixedRateBondForwardWrap::underlyingCleanPrice()
{
	return underlying_.cleanPrice();
}

QuantLib::Real FixedRateBondForwardWrap::underlyingDirtyPrice()
{
	return underlying_.dirtyPrice();
}

QuantLib::Real FixedRateBondForwardWrap::underlyingAccruedAmount(Date settlementDate)
{
	return underlying_.accruedAmount(settlementDate) * factor_;
}

QuantLib::Real FixedRateBondForwardWrap::income()
{
	return spotIncome(this->discountCurve()) * factor_;
}

